########################
## In the name of God ##
########################

"""

Hi. Me(Pedram Shakerinava) and my brother(Mehran Shakerinava) have written this program. 
We both have accounts in Brilliant.org with the names <Pedram S> ans <Mehran S> And we are 16 and 17 years old 
and we live in Iran. 
First of all we want to thank you for preparing this competition and letting us to compete in it worldwide. 

Now, The idea of our program is that we're always trying to reach the medium of the player reputations in each round. 
Thereby, we first of all find it from the "player_reputations" list, and depending on that, the number of hunts and slacks 
which we're going to do in that round, will be found: 
<< the (R) we want to reach after the round * total (H + S) after this round = total (H) after this round >> 
And the number of slacks after this round will be: 
<< total (S) after this round = total (H + S) after this round - total (H) after this round >> 
Then we want to slack with those reputations from the most and the less reputations(which are closer to those who are just 
hunting or slacking and it's better for us to slack with them). For this we take a 2D array of the player reputations with 
the name "k_places" which in this array: 
<< k_places[i][0] = player_reputation[i] , k_places[i][1] = i >> 
the reason which we've taken a 2D array and saved the (i)'s is that we're going to sort it, and if we didn't do that the(i)'s 
would be lost... 
After we sort it, from the beginning and the end of this array, we start to slack with the reputations which are most close 
to either 1 or 0 and save the answer in hunt_desicions. And after this, because we dont't want to cooperate with any 
reputation which is 0 or 1 (because they are almost surely just repeating something and the best result with them would be
to slack) we iterate on k_places and find the 1's and the 0's and get sure that the answer relating to them is 's'
More explanations if neaded is in the program...

Thank you for reading this.
I want to add that I didn't know how to program with Python, and although I don't see to use it a lot in the future, but this
competition made me to learn it. Thanks a lot!

"""




	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN#
	#                                                                                                    #
	#                                          R  A      A  R                                            #
	#                                        R   A   AA   A   R                                          #
	#                                       R   A    AA    A   R                                         #
	#                                      R   AA    AA    AA   R                                        #
	#                                       R   A    AA    A   R                                         #
	#                                        R    A  AA  A    R                                          #
	#                                          R    AAAA    R                                            #
	#                                              A AA A                                                #
	#                                                                                                    #
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#
	#IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII#




global h, s, t_hs

def hunt_choices(round_number, current_food, current_reputation, m, player_reputations):
	
	if round_number == 1:
		h = 0									# h => number of hunts we have done from the beginning of the game
		s = 0									# s => number of slacks we have done from the beginning of the game
		t_hs = 0								# t_hs => total number of slacks and hunts after the current round
	pass
	
	t_hs += len(player_reputations)
	k = player_reputations
	
	k_places = []								# k_places => the list of player reputations with their correct places
	for i in xrange(len(k)):					# .
		k_places.append([])						# .
		k_places[i].append(k[i])				# .
		k_places[i].append(i)					# .
	pass										# now ready to be sorted
	
	k_places.sort()
	pass
	
	if len(k_places) % 2 == 1:
		mid_r = k_places[len(k_places)/2][0]	# mid_r => the reputation we want to reach after this round, which will be the medium of the other players reputations in this round 
	else:
		mid_r = k_places[(len(k_places)/2)-1][0]
	pass
	
	t_h = mid_r * t_hs							# t_h => the number of total hunts we must have done at the end of the current round to have reached mid_r
	t_h = t_h - t_h % 1							# making it a natural number
	n_h = t_h - h								# n_h => the number of hunts we must do in the current round to reach t_h, and in the result to reach mid_r
	n_s = len(player_reputations) - n_h			# n_s => the number of slacks we must do in the current round, which depends on n_h
	h += n_h									# the total number of hunts in the end of this round
	s += n_s									# the total number of slacks in the end of this round
	b = 0										# b => the slot at the beginning of k_places
	e = len(k_places) - 1						# e => the slot at the end of k_places
	
	hunt_decisions = []							# hunt_decisions => the array of the final answers
	for i in range(len(player_reputations)):
		hunt_decisions.append('h')				# first we'll it with hunts, later we'll correct them
	pass
	
	i=0
	while i < n_s:
		if k_places[b][0] == 0:
			hunt_decisions[k_places[b][1]] = 's'
			b += 1
		elif k_places[e][0] == 1:
			hunt_decisions[k_places[e][1]] = 's'
			e -= 1
			
		elif k_places[b][0] < 1 - k_places[e][0]:
			hunt_decisions[k_places[b][1]] = 's'
			b += 1
		else:
			hunt_decisions[k_places[e][1]] = 's'
			e -= 1
		i += 1
	pass										# now it's filled correctly,
	
	for i in range(len(k_places)):				# but we want to be sure that we don't cooperate with someone who has a reputation of 1 or 0
		if k_places[i][0] == 0:
			hunt_decisions[k_places[i][1]] = 's'
			h -= 1
		elif k_places[i][0] == 1:
			hunt_decisions[k_places[i][1]] = 's'
			s -= 1
	pass									# done
	
	return hunt_decisions;
	
def hunt_outcomes(food_earnings):
    pass # do nothing

def round_end(award, m, number_cooperators):
    pass # do nothing